package graph;

public class GraphvizTest {

    /**
     * @param args
     */

    static {
        System.loadLibrary("gv");
    }

    public static void main(String[] args) {

        
//        FOR MANUAL GRAPH GENERATION, WRITE THE FOLLOWING TO A .gv FILE AND OPEN THE FILE WITH GRAPHVIZ.APP
        
        // graph {
        // a -- b;
        // b -- c;
        // a -- c;
        // d -- c;
        // e -- c;
        // e -- a;
        // }
        //
        
        
        
        
        
        // FOR AUTOMATIC GRAPH GENERATION, RUN THE FOLLOWING CODE

//        SWIGTYPE_p_Agraph_t g, gv, sg;
//        SWIGTYPE_p_Agnode_t n, m;
//        SWIGTYPE_p_Agedge_t e;
//
//        g = gv.digraph("G");
//        System.out.println(gv.setv(g,"aaa","xxx"));
//        System.out.println(gv.getv(g,"aaa"));
//        sg = gv.graph(g,"SG");
//        n = gv.node(g,"hello");
//        System.out.println(gv.getv(n,"label"));
//        System.out.println(gv.setv(n,"aaa","xxx"));
//        System.out.println(gv.getv(n,"aaa"));
//        m = gv.node(g,"world");
//            System.out.println(gv.getv(m,"aaa"));
//        e = gv.edge(n,m);
//        System.out.println(gv.setv(e,"aaa","xxx"));
//            System.out.println(gv.getv(e,"aaa"));
//        gv.rm(e);
//        gv.rm(n);
//        gv.rm(m);
//        gv.rm(g);
//
//        g = gv.readstring("digraph G {a->b}");
//        gv.rm(g);
//
//        g = gv.read("hello.gv");
//        gv.layout(g,"dot");
//        gv.render(g,"png","hello.png");
//        gv.rm(g);
//        }

    }

}
